from typing import Any

try:
    from .entities import *
    from .entity import Entity
    from .event import Event
    from .events import EventTypes
    from .jsobj import JavascriptObject
    from .player import Player
    from .utils import overload
except ImportError:
    from entities import *  # type: ignore
    from entity import Entity  # type: ignore
    from event import Event  # type: ignore
    from events import EventTypes  # type: ignore
    from jsobj import JavascriptObject  # type: ignore
    from player import Player  # type: ignore
    from utils import overload  # type: ignore

__all__ = ['Types', 'txt_importance', 'bg_importance', 'EventTypes']


class _Types:
    """The types that might be used.
    """

    __getitem__ = object.__getattribute__

    def __setattr__(self, name: str, value: Any) -> None:
        raise NotImplementedError

    JavascriptObject = JavascriptObject

    Player = Player

    overload = overload

    Entity = Entity

    Event = Event

    Building = Building
    Lab = Lab
    Mountain = Mountain
    River = River
    Tree = Tree
    Unit = Unit
    Warrior = Warrior
    Mineral = Mineral
    Wood = Wood
    Stone = Stone
    Metal = Metal


Types = _Types()

# How important an entity's char_rep() is, from high to low.
txt_importance = [
    Warrior,
    Lab,
]
# How important an entity's backgrnd_rep() is, from high to low.
bg_importance = [
    Metal,
    Stone,
    Wood,
    Lab,
    Base,
    River,
    Mountain,
    Tree,
]
